package com.xzlf.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
public class DemoController {

    @Value("${server.port}")
    private String port;

    @GetMapping
    public String demo() throws InterruptedException {
//        TimeUnit.SECONDS.sleep(2);
        return "测试spring cloud provide -- " + port;
    }

    @GetMapping("/testGet")
    public String testGet(){
        System.out.println("testGet（） 执行了。。。");
        return "Test Get";
    }

    @PostMapping("/testPost")
    public String tsetPost(){
        System.out.println("testPost（） 执行了。。。");
        return "Test Post";
    }
}
